import global from "./mars3d";
const mapOptions: any = {
    scene: {
        center: { lat: 29.565529, lng: 106.54807, alt: 1000, heading: 0, pitch: -90 },
        removeDblClick: true,
        showSkyBox: true,
        contextOptions: {
            webgl: {
                preserveDrawingBuffer: true, // 截图是黑色时，需要将该项设置为true
            },
        },
    },
    control: {
        mouseDownView: true, // 鼠标滚轮缩放美化样式
        infoBox: false, // 是否显示 点击要素之后显示的信息
        baseLayerPicker: true, // 是否显示 basemaps底图切换按钮
        defaultContextMenu: false, // 是否绑定默认的地图右键菜单
        selectionIndicator: false, // 选择模型时，是否显示绿色框
        fullscreenButton: true, // 是否显示 全屏按钮
        contextmenu: {
            hasDefault: false,
        },
        compass: {
            bottom: "310px",
            right: "5px",
        }, // 导航球控件
        distanceLegend: true, // 比例尺控件
        animation: false, // 是否创建 左下角仪表动画面板
        timeline: false, // 是否创建 下侧时间线控件面板
        vrButton: false, // 是否显示 右下角vr虚拟现实按钮
        geocoder: false, // 是否显示 地名查找控件按钮
        homeButton: true, // 是否显示 视角复位按钮
        sceneModePicker: true, // 是否显示 二三维视图切换按钮
        projectionPicker: false, // 是否显示 用于在透视和正投影之间进行切换按钮
        navigationHelpButton: true, // 是否显示 帮助按钮
        navigationInstructionsInitiallyVisible: false, // 在用户明确单击按钮之前是否自动显示
        showRenderLoopErrors: true, // 如果为true，则在发生渲染循环错误时，此小部件将自动向包含错误的用户显示HTML面板。
        // 以下是mars3d.control定义的控件
        zoom: { insertIndex: 2 },
        locationBar: {
            fps: true,
            template: "<div>经度:{lng}</div> <div>纬度:{lat}</div> <div>海拔：{alt}米</div> <div>层级：{level}</div><div>方向：{heading}度</div> <div>俯仰角：{pitch}度</div><div>视高：{cameraHeight}米</div>",
        },
    },
    basemaps: [
        {
            pid: 16,
            id: 161,
            name: "天地图影像",
            icon: "http://mars3d.cn/img/basemaps/tdt_img.png",
            type: "tdt",
            layer: "img_d",
            key: ["789e558be762ff832392a0393fd8a4f1"],
            show: true,
            hasZIndex: true,
            zIndex: 0,
        },
        {
            id: 2021,
            pid: 10,
            name: "高德影像",
            type: "group",
            icon: "http://mars3d.cn/img/basemaps/gaode_img.png",
            layers: [
                { name: "底图", type: "gaode", layer: "img_d" },
                { name: "注记", type: "gaode", layer: "img_z" },
            ],
        },
        {
            pid: 10,
            name: "百度影像",
            type: "group",
            icon: "http://mars3d.cn/img/basemaps/bd-img.png",
            layers: [
                { name: "底图", type: "baidu", layer: "img_d" },
                { name: "注记", type: "baidu", layer: "img_z" },
            ],
        },
        {
            pid: 10,
            name: "ArcGIS影像",
            icon: "http://mars3d.cn/img/basemaps/esriWorldImagery.png",
            type: "xyz",
            url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
            enablePickFeatures: false,
        },
        {
            name: "Ion影像地图",
            icon: "http://mars3d.cn/img/basemaps/bingAerial.png",
            type: "ion",
            assetId: 2,
            accessToken: global.mars3d.Token.ion,
        },
        {
            name: "Ion电子地图",
            icon: "http://mars3d.cn/img/basemaps/bingmap.png",
            type: "ion",
            assetId: 4,
            accessToken: global.mars3d.Token.ion,
        },
        {
            id: 2017,
            pid: 10,
            name: "蓝色底图",
            icon: "http://mars3d.cn/img/basemaps/bd-c-midnight.png",
            type: "xyz",
            url: "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}",
            chinaCRS: "GCJ02",
            enablePickFeatures: false,
        },
        {
            pid: 10,
            name: "黑色底图",
            icon: "http://mars3d.cn/img/basemaps/bd-c-dark.png",
            type: "tencent",
            layer: "custom",
            style: "4",
        },
    ],
    terrain: {
        url: "//data.marsgis.cn/terrain",
        show: true,
    },
    layers: [
        {
            pid: 15,
            id: 151,
            name: "行政区划界线",
            type: "xyz",
            url: "https://t{s}.tianditu.gov.cn/DataServer?T=ibo_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1",
            subdomains: "01234567",
            maximumLevel: 10,
            mapSplit: false,
            show: true,
            zIndex: 1,
        },
        {
            pid: 15,
            id: 152,
            name: "天地图注记",
            type: "tdt",
            layer: "img_z",
            key: ["789e558be762ff832392a0393fd8a4f1"],
            show: true,
            zIndex: 99,
        },
    ],
};
export default mapOptions;
